 /// @file ExchangeRouthness.h
 /// @brief ExchangeRouthness 
 /// @copyright Copyright (c) 2025  Hefei Jiushao Intelligent Technology Co., Ltd. All rights reserved.
 /// @createtime 2025-04-07

#ifndef EXCHANGECOREROUTHNESS_H
#define EXCHANGECOREROUTHNESS_H
#include "ExchangePMIBase.h"
#include "vector"

namespace  AMCAX::Exchange::Core::PMI {

    /// Enum for roughness obtention type
    enum class PMIRoughnessObtentionType
    {
        UnSupported,
        NotDefined,
        MachiningMandatory,
        MachiningForbidden
    };
    ENUM_TO_STRING_CASE_ALL(
        PMIRoughnessObtentionType,
        ENUM_CASE(PMIRoughnessObtentionType, UnSupported)
        ENUM_CASE(PMIRoughnessObtentionType, NotDefined)
        ENUM_CASE(PMIRoughnessObtentionType, MachiningMandatory)
        ENUM_CASE(PMIRoughnessObtentionType, MachiningForbidden)
    )

    /// Enum for roughness applicability type
    enum class PMIRoughnessApplicabilityType{
        UnSupported,
        SpecifiedSurfaceOnly,
        AllPartSurfaces,
        BasicSurface
    } ;
    ENUM_TO_STRING_CASE_ALL(
        PMIRoughnessApplicabilityType,
        ENUM_CASE(PMIRoughnessApplicabilityType, UnSupported)
        ENUM_CASE(PMIRoughnessApplicabilityType, SpecifiedSurfaceOnly)
        ENUM_CASE(PMIRoughnessApplicabilityType, AllPartSurfaces)
        ENUM_CASE(PMIRoughnessApplicabilityType, BasicSurface)
    )

    class ExchangeRoughness : public ExchangePMIAnnotation
    {
    public:
        ~ExchangeRoughness() = default;

        PMIAnnotationType GetType() const override
        {
            return PMIAnnotationType::Roughness;
        } 

        /// @brief Set the obtention type of the roughness.
        /// @param[in] obtentionType The obtention type to set.
        void SetRoughnessObtentionType(const PMIRoughnessObtentionType &obtentionType){
            this->obtentionType = obtentionType ;
        } ;

        void SetRoughnessApplicabilityType(const PMIRoughnessApplicabilityType &applicabilityType){
            this->applicabilityType = applicabilityType ;
        } ;

        void AddRoughnessField(const std::string &field){
            this->roughnessField.push_back(field) ;
        } ;
        std::string ToString()override ;
    private:
        /// The type of the roughness obtention.
        PMIRoughnessObtentionType obtentionType ;
        /// The type of the roughness applicability.
        PMIRoughnessApplicabilityType applicabilityType ;
        /// The list of roughness fields.
        std::vector<std::string> roughnessField ;
    } ;

}

#endif